﻿<UserControl x:Class="VH.View.UserLoginView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             mc:Ignorable="d"
             Background="{StaticResource GradientBackgroundBrush}"
             xmlns:resources="clr-namespace:VH.Resources;assembly=VH.Resources"
             xmlns:userControls="clr-namespace:VH.UI.UserControls;assembly=VH.UI.UserControls"
             xmlns:controls="clr-namespace:VH.UI.UserControls;assembly=VH.UI.UserControls"
             FocusManager.FocusedElement="{Binding ElementName=txtUserName}">
    <AdornerDecorator>
        <Grid x:Name="VisualRoot">
            <Grid.InputBindings>
                <!--<KeyBinding Gesture="CTRL+Enter" Command="{Binding InquiryCommand}" />-->
            </Grid.InputBindings>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="10" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="90" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0">
                <Border Grid.RowSpan="4" Grid.ColumnSpan="3"
                        BorderBrush="{StaticResource WindowBorderBrush}"
                        BorderThickness="1"
                        Background="{StaticResource GradientBackgroundBrush}"
                        Padding="3.5">
                    <Grid VerticalAlignment="Top">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="85" />
                        </Grid.ColumnDefinitions>

                        <TextBox
                            x:Name="txtUserName"
                            Grid.Column="0" Grid.Row="0"
                            Text="{Binding LoginName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                            FontWeight="Bold"
                            HorizontalAlignment="Left" VerticalAlignment="Center"
                            Width="220" MaxLength="50" Margin="3.5">
                            <i:Interaction.Behaviors>
                                <userControls:TextBoxWatermarkBehavior
                                    Label="{x:Static  resources:LabelResources.UserName}"
                                    LabelStyle="{StaticResource WatermarkTextBlockStyle}" />
                            </i:Interaction.Behaviors>
                        </TextBox>

                        <PasswordBox Grid.Column="0" Grid.Row="1"
                                     controls:PasswordBoxHelper.BoundPassword="{Binding LoginPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                                     FontWeight="Bold"
                                     HorizontalAlignment="Left" VerticalAlignment="Center"
                                     Width="220" MaxLength="50" Margin="3.5">
                            <i:Interaction.Behaviors>
                                <userControls:PasswordBoxWatermarkBehavior
                                    Label="{x:Static  resources:LabelResources.Password}"
                                    LabelStyle="{StaticResource WatermarkTextBlockStyle}" />
                            </i:Interaction.Behaviors>
                        </PasswordBox>

                        <Button Grid.Column="1" Grid.Row="1"
                                Style="{StaticResource HyperlinkButtonStyle}"
                                Margin="3.5"
                                Content="SIGN IN"
                                FontWeight="Bold" FontSize="10"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Center"
                                Command="{Binding SignInCommand}"
                                IsDefault="True">
                        </Button>

                        <CheckBox Grid.Column="0" Grid.Row="2"
                                  FontSize="{StaticResource ControlContentFontSize}"
                                  Content="{x:Static  resources:LabelResources.RememberPassword}"
                                  Margin="3.5" VerticalAlignment="Center"
                                  Opacity="0.6" />
                        <CheckBox Grid.Column="0" Grid.Row="3"
                                  FontSize="{StaticResource ControlContentFontSize}"
                                  Content="{x:Static  resources:LabelResources.RememberMe}"
                                  Margin="3.5" VerticalAlignment="Center"
                                  Opacity="0.6"
                                  Visibility="Collapsed" />
                        <CheckBox Grid.Column="1" Grid.Row="3"
                                  FontSize="{StaticResource ControlContentFontSize}"
                                  Content="{x:Static  resources:LabelResources.SignMe}"
                                  Margin="3.5" VerticalAlignment="Center"
                                  Opacity="0.6" Visibility="Collapsed" />
                    </Grid>
                </Border>
            </Grid>

            <Button Grid.Row="2"
                    Style="{StaticResource MetroButtonStyle}"
                    FontWeight="Normal" FontSize="16"
                    Content="{x:Static  resources:LabelResources.CreateNewAccount}"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Bottom"
                    Visibility="Collapsed">
            </Button>

            <Button Grid.Row="3"
                    Style="{StaticResource MetroButtonStyle}"
                    FontWeight="Normal" FontSize="16"
                    Content="{x:Static  resources:LabelResources.ForgetPassword}"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Top"
                    Visibility="Collapsed">
            </Button>

            <Button Grid.Row="5"
                    Style="{StaticResource HyperlinkButtonStyle}"
                    Margin="3.5"
                    FontWeight="Bold"
                    Content="CANCEL"
                    Command="{Binding CloseCommand}"
                    HorizontalAlignment="Right" VerticalAlignment="Center"
                    IsCancel="True">
            </Button>
        </Grid>
    </AdornerDecorator>
</UserControl>
